<template>
  <div class="book-container">
    <h1>book-homeIndex</h1>
    <router-view></router-view>
  </div>
</template>

<script>
/**
 *
 * vue定义数据在哪儿？
 * 1. data() {}
 * 2. computed: {} 计算属性
 * 3. vuex->state
 *
 * vue组件中，碰到异步数据拿不到怎么办？
 *
 * 1.
 *
 * vue
 *  this.$set  Vue.set([], obj, '')
 *
 */

import { mapState, mapActions } from 'vuex'
export default {
  name: "BookIndex",
  data() {
    return {
    }
  },
  mounted() {
    this.getBookList()
  },
  computed: {
    // ...mapState(['bookStore'])
  },
  watch: {
    bookStore(v) {
      // console.log('我是监听到的数据', v)
    }
  },
  methods: {
    ...mapActions('book', ['update_Book']),
    async getBookList() {
      this.update_Book()
    }
  },
}
</script>

<style>
</style>
